from Base import message, intersect, SS_VALID
from DRG import MDCR_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["92.2001","92.2700x002","92.2700x004","92.2701","92.2702","92.2703","92.2704","92.2705","92.2706","92.2800","92.2801","92.2900x001","92.2900x002","92.2900x003","92.3300"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合RL2入组条件，匹配规则：主手术匹配')

    if MDCR_DRG.RL21_group(record):
      return 'RL21'

    if MDCR_DRG.RL23_group(record):
      return 'RL23'

    if MDCR_DRG.RL25_group(record):
      return 'RL25'
        
    return 'RL2'
  else:
    return ''
    
